<!DOCTYPE html>
<html lang="en">
<head>
  
<meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title></title>
  <meta name="viewport" content="initial-scale=1, maximum-scale=1">
  <!-- <link rel="shortcut icon" href="http://favicon.ico"> -->
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="viewport" content="width=device-width, height=device-height, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">


  <link rel="stylesheet" href="../../../css/sm.min.css">
  <link rel="stylesheet" href="../../../css/sm-extend.min.css">
  <script type="text/javascript" src="../../../common/common.js"></script>


  <!-- Link Swiper's CSS -->
  <link rel="stylesheet" href="../../../css/swiper.min.css">

  <style>
       html, body {
      position: relative;
      height: 100%;
    }
    body {
      background: #eee;
      font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
      font-size: 14px;
      color:#000;
      margin: 0;
      padding: 0;
    }
    .swiper-container {
      width: 100%;
      height: 100%;
    }
    .swiper-slide {
      text-align: center;
      font-size: 18px;
      background: #fff;
      /* Center slide text vertically */
      display: -webkit-box;
      display: -ms-flexbox;
      display: -webkit-flex;
      display: flex;
      -webkit-box-pack: center;
      -ms-flex-pack: center;
      -webkit-justify-content: center;
      justify-content: center;
      -webkit-box-align: center;
      -ms-flex-align: center;
      -webkit-align-items: center;
      align-items: center;
    }
    .swiper-pagination-bullet {
      width: 20px;
      height: 20px;
      text-align: center;
      line-height: 20px;
      font-size: 12px;
      color:#000;
      opacity: 1;
      background: rgba(0,0,0,0.2);
    }
    .swiper-pagination-bullet-active {
      color:#fff;
      background: #007aff;
    }
  </style>
</head>
<body>
  
  <div class="page-group">
    <div class="page">
      
      <!-- 页面内容区域 -->
      <!-- Add Pagination -->
      <!-- <div class="swiper-pagination"></div> -->
      <div class="swiper-containerTwo" style="height:50%;height: 1.5rem;">
          <div class="swiper-wrapper">
              <div class="swiper-slide">
                <span onclick="toclick('1')">
                  Slide 1
                </span>
              </div>
              <div class="swiper-slide slide-1">Slide 2</div>
              <div class="swiper-slide slide-new">
                  <span onclick="toclick('3')">
                      Slide 3
                  </span>
              </div>
              <div class="swiper-slide">Slide 4</div>
              <div class="swiper-slide">Slide 5</div>
              <div class="swiper-slide">Slide 6</div>
              <div class="swiper-slide">Slide 7</div>
          </div>
      </div>

      <br>
       <!-- Swiper -->
        <div class="swiper-containerOne" style="height:50%;">
            <div class="swiper-wrapper">
                <div class="swiper-slide">
                    <!-- Slide 1 -->

                    <div class="list-block media-list inset" style="width:100%; height:100%;">
                        <ul style="width:100%; height:100%;">
                          <li>
                            <a href="#" class="item-link item-content">
                              <div class="item-media"><img src="http://gqianniu.alicdn.com/bao/uploaded/i4//tfscom/i3/TB10LfcHFXXXXXKXpXXXXXXXXXX_!!0-item_pic.jpg_250x250q60.jpg" style='width: 2.2rem;'></div>
                              <div class="item-inner">
                                <div class="item-title-row">
                                  <div class="item-title">标题</div>
                                  <div>317m</div>
                                </div>
                                <div class="item-subtitle" style="text-align: left;">子标题</div>
                              </div>
                            </a>
                          </li>
                        </ul>
                      </div>

                </div>
                <div class="swiper-slide">Slide 2</div>
                <div class="swiper-slide">Slide 3</div>
                <div class="swiper-slide">Slide 4</div>
                <div class="swiper-slide">Slide 5</div>
                <div class="swiper-slide">Slide 6</div>
                <div class="swiper-slide">Slide 7</div>
                <div class="swiper-slide">Slide 8</div>
                <div class="swiper-slide">Slide 9</div>
                <div class="swiper-slide">Slide 10</div>
            </div>
        </div>
        <!-- <p class="append-buttons">
          <a href="#" class="slide-1">Slide 1</a>
          <a href="#" class="slide-250">Slide 250</a>
          <a href="#" class="slide-500">Slide 500</a>
        </p> -->


    </div>
  </div>

  
  <!-- 固定的js引用，所有的jQuery 要用 $$ 表示 -->
<script type="text/javascript" src="https://gitee.com/huaflower/JinTianGuoJiCommonFile/raw/master/js/jquery-1.11.1.min.js"></script>
<!-- 这一行代码是为了 避免js冲突 -->
<script type="text/javascript">var $$ =jQuery.noConflict();</script>

<script type='text/javascript' src='https://gitee.com/huaflower/JinTianGuoJiCommonFile/raw/master/zepto/zepto.min.js' charset='utf-8'></script>
<script type='text/javascript' src='https://gitee.com/huaflower/JinTianGuoJiCommonFile/raw/master/js/sm.min.js' charset='utf-8'></script>
<!-- <script type='text/javascript' src='https://gitee.com/huaflower/JinTianGuoJiCommonFile/raw/master/js/sm-extend.min.js' charset='utf-8'></script> -->
<script src="https://gitee.com/huaflower/JinTianGuoJiCommonFile/raw/master/js/swiper/swiper.min.js"></script>


<!-- Swiper JS -->
<script src="../../../js/swiper/swiper.min.js"></script>

<script type="text/javascript">

  
  var swiper1;
  //放函数区域
  function toSwiper1() {
    // var swiper = new Swiper('.swiper-containerOne', {
    //   pagination: {
    //     el: '.swiper-pagination',
    //     clickable: true,
    //     renderBullet: function (index, className) {
    //     //   return '<span class="' + className + '">' + (index + 1) + '</span>';
    //     // return '<div class="swiper-slide ' + className + '">' + (index + 1) + '</div>';
    //     // return '<div class="swiper-slide"><span class="' + className + '">' + (index + 1) + '</span></div>';
    //     },
    //   },
    // });
    swiper1 = new Swiper('.swiper-containerOne', {
      slidesPerView: 1,
      // centeredSlides: true,
      // spaceBetween: 30,
      pagination: {
        el: '.swiper-pagination',
        type: 'fraction',
      },
      // navigation: {
      //   nextEl: '.swiper-button-next',
      //   prevEl: '.swiper-button-prev',
      // },
      // virtual: {
      //   slides: (function () {
      //     var slides = [];
      //     for (var i = 0; i < 600; i += 1) {
      //       slides.push('Slide ' + (i + 1));
      //     }
      //     return slides;
      //   }()),
      // },
      // on: {
      //   init: function () {
      //     alert(1)
      //     console.log('swiper initialized');
      //   },
      // },
      on: {
	    				// slideChangeTransitionEnd: function () {
              //
              
              slideChange:function (){
                // alert(swiper1.activeIndex);
                console.log(swiper1.activeIndex)
              }
          }
    });
  }
  // swiper1.slideChange()
  // swiper1.slideChange('slideChange', function () {
  //   console.log('slide changed');
  // });
  // swiper1.on('init', function() { /* do something */ 
  //   alert(1);
  // });
  function toSwiper2() {
    var swiper2 = new Swiper('.swiper-containerTwo', {
      slidesPerView: 5,
      spaceBetween: 2,
      // init: false,
      pagination: {
        el: '.swiper-pagination',
        clickable: true,
      },
    //   breakpoints: {
    //     1024: {
    //       slidesPerView: 4,
    //       spaceBetween: 40,
    //     },
    //     768: {
    //       slidesPerView: 3,
    //       spaceBetween: 30,
    //     },
    //     640: {
    //       slidesPerView: 2,
    //       spaceBetween: 20,
    //     },
    //     320: {
    //       slidesPerView: 1,
    //       spaceBetween: 10,
    //     }
    //   }
    });
  };
  function toclick(val) {
    if(val === '1'){
      swiper1.slideTo(0, 0);
    }
    if(val === '3'){
      swiper1.slideTo(2, 0);
    }
  }

  // document.querySelector('.slide-1').addEventListener('click', function (e) {
  //   alert(1)
  //     e.preventDefault();
  //     swiper1.slideTo(0, 0);
  //   });
  //   document.querySelector('.slide-250').addEventListener('click', function (e) {
  //     e.preventDefault();
  //     swiper1.slideTo(2, 0);
  //   });
  //   document.querySelector('.slide-500').addEventListener('click', function (e) {
  //     e.preventDefault();
  //     swiper1.slideTo(5, 0);
  //   });

  //需要初始化传递数据的函数，函数名，跟参数都不要变，固定写死的
  function getParams(data){
   // data需要转成json调用 ，函数urlParamParseJson();
     /*var jodata = JSON.parse(data); 
     if(isNotNull(jodata)){//
        
     }*/
     if(isNotNull(data)){
        // $$("#div_version").html("版本号：V"+data);
     }
  }



  	
    // 初始化
    $(function(){
      $.init();
      toSwiper1();
      toSwiper2();
    });
  </script>

</body>
</html>